package util

import "sync"

type tokenUtil struct {
	tokenMap map[string]uint //token用于存放用户信息
}

var once sync.Once
var instance *tokenUtil

func GetInstance() *tokenUtil {
	once.Do(func() {
		instance = new(tokenUtil)
		instance.tokenMap = map[string]uint{}
	})
	return instance
}
func (t *tokenUtil) Put(k string, v uint) {
	t.tokenMap[k] = v
}
func (t *tokenUtil) Get(k string) uint {

	return t.tokenMap[k]
}
